package vista;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author jjcamacho
 */
public class VentanaGeneral1 extends javax.swing.JFrame {

    private Vista v;

    public VentanaGeneral1(Vista vista) {
        setIconImage(new ImageIcon(getClass().getResource("Img/logo.png")).getImage());
        setLocationRelativeTo(null);
        v = vista;
        initComponents();
        this.jContenedor.add((JPanel) v);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jContenedor = new javax.swing.JPanel();
        bnCerrar = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setLocationByPlatform(true);
        setResizable(false);

        jContenedor.setPreferredSize(new java.awt.Dimension(828, 478));
        jContenedor.setLayout(new javax.swing.BoxLayout(jContenedor, javax.swing.BoxLayout.LINE_AXIS));

        bnCerrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/vista/Img/Salir.PNG"))); // NOI18N
        bnCerrar.setMnemonic('r');
        bnCerrar.setText("Cerrar");
        bnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnCerrarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jContenedor, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)
                    .addComponent(bnCerrar))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jContenedor, javax.swing.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bnCerrar)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCerrarActionPerformed
        dispose();
    }//GEN-LAST:event_bnCerrarActionPerformed

    public void display() {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                setVisible(true);
                v.display();
            }
        });

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bnCerrar;
    private javax.swing.JPanel jContenedor;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables
}
